function [] = showVid(inputVideo,outputVideo, xc, yc, zoomFactor)
nFrames = size(xc,1);
Wmax = 640;%still video width in pixels
Hmax = 360;%still video height in pixels

%size of the moving frame
outputWidth = Wmax/2;
outputHeight = Hmax/2;

width = outputWidth./zoomFactor;
height = outputHeight./zoomFactor;

% calculation of top-left corner of the moving frame
xmin = min(max(floor(xc - width/2),1),Wmax-width);
ymin = min(max(floor(yc - height/2),1),Hmax-height);

% initialize the y,u,v params
y = zeros(outputHeight,outputWidth,nFrames);
u = zeros(outputHeight/2,outputWidth/2,nFrames);
v = zeros(outputHeight/2,outputWidth/2,nFrames);


for frame = 1:(nFrames - 1)
    [Y U V] = yuvread(inputVideo,Wmax,Hmax,frame,1);
    y(:,:,frame) = imresize(imcrop(Y,[xmin(frame) ymin(frame) width(frame) height(frame)]),[outputHeight outputWidth]);
    u(:,:,frame) = imresize(imcrop(U,[xmin(frame)/2 ymin(frame)/2 width(frame)/2 height(frame)/2]),[outputHeight/2 outputWidth/2]);
    v(:,:,frame) = imresize(imcrop(V,[xmin(frame)/2 ymin(frame)/2 width(frame)/2 height(frame)/2]),[outputHeight/2 outputWidth/2]);
end

writeyuv(outputVideo,y,u,v);

end
